if (! valid) {
gbfprintf(fout, "#####\n");
fatal(MYNAME ": %s (%s) is outside of convertable area \"%s\"!\n",
- wpt->shortname.isEmpty() ? "Waypoint" : CSTR(wpt->shortname),
+ wpt->shortname.isEmpty() ? "Waypoint" : qPrintable(wpt->shortname),
pretty_deg_format(wpt->latitude, wpt->longitude, 'd', NULL, 0),
gt_get_mps_grid_longname(grid_index, MYNAME));
}
if ((wpt->latitude < -90) || (wpt->latitude > 90.0))
fatal("Invalid latitude %f in waypoint %s.\n",
- lat_orig, !wpt->shortname.isEmpty() ? CSTRc(wpt->shortname) : "<no name>");
+ lat_orig, !wpt->shortname.isEmpty() ? qPrintable(wpt->shortname) : "<no name>");
if ((wpt->longitude < -180) || (wpt->longitude > 180.0))
fatal("Invalid longitude %f in waypoint %s.\n",
- lon_orig, !wpt->shortname.isEmpty() ? CSTRc(wpt->shortname) : "<no name>");
+ lon_orig, !wpt->shortname.isEmpty() ? qPrintable(wpt->shortname) : "<no name>");
}
/*-----------------------------------------------------------------------------*/
GeoReadLoc();
if (reader.hasError()) {
fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
- CSTR(reader.errorString()),
- CSTR(file.fileName()),
+ qPrintable(reader.errorString()),
+ qPrintable(file.fileName()),
(long) reader.lineNumber(),
(long) reader.columnNumber());
}
if (global_opts.debug_level >= 1)
printf(MYNAME " route_hdr: route name \"%s\" num_legs = %d\n",
- CSTRc(rte->rte_name), num_legs);
+ qPrintable(rte->rte_name), num_legs);
}
if (global_opts.debug_level >= 2) {
printf(MYNAME " adding waypt %s (%s) to table at index %d\n",
- CSTRc(wpt->shortname), CSTRc(wpt->description), waypt_table_ct);
+ qPrintable(wpt->shortname), qPrintable(wpt->description), waypt_table_ct);
}
waypt_table[waypt_table_ct] = (Waypoint*)wpt;
if (global_opts.debug_level >= 1) {
printf(MYNAME " parse_waypoints: name = %s, uid_unit = %u, "
"uid_seq_low = %d, uid_seq_high = %d, lat = %f, lon = %f, depth = %f\n",
- CSTRc(wpt_tmp->shortname), fsdata->uid_unit,
+ qPrintable(wpt_tmp->shortname), fsdata->uid_unit,
fsdata->uid_seq_low, fsdata->uid_seq_high,
wpt_tmp->latitude, wpt_tmp->longitude, wpt_tmp->depth);
}
if (global_opts.debug_level >= 1) {
printf(MYNAME " parse_routes: route name=%s has %d waypoints\n",
- CSTRc(rte_head->rte_name), num_legs);
+ qPrintable(rte_head->rte_name), num_legs);
}
for (j = 0; j < num_legs; ++j) {
if (wpt_tmp) {
if (global_opts.debug_level >= 2) {
printf(MYNAME " parse_routes: added wpt %s to route %s\n",
- CSTRc(wpt_tmp->shortname), CSTRc(rte_head->rte_name));
+ qPrintable(wpt_tmp->shortname), qPrintable(rte_head->rte_name));
}
route_add_wpt(rte_head, new Waypoint(*wpt_tmp));
}
if (global_opts.debug_level >= 1) {
printf(MYNAME " parse_trails: trail %d name=%s has %d trackpoints\n",
- trk_num, CSTRc(trk_head->rte_name), num_trail_pts);
+ trk_num, qPrintable(trk_head->rte_name), num_trail_pts);
}
for (j = 0; j < num_trail_pts; ++j) {
if (global_opts.debug_level >= 2) {
printf(MYNAME " parse_routes: added trackpoint %f,%f to route %s\n",
- wpt_tmp->latitude, wpt_tmp->longitude, CSTRc(trk_head->rte_name));
+ wpt_tmp->latitude, wpt_tmp->longitude, qPrintable(trk_head->rte_name));
}
}
}
for (i = 0; i < waypt_table_ct; ++i) {
if (global_opts.debug_level >= 2) {
printf(MYNAME " writing out waypt %d (%s - %s)\n",
- i, CSTRc(waypt_table[i]->shortname), CSTRc(waypt_table[i]->description));
+ i, qPrintable(waypt_table[i]->shortname), qPrintable(waypt_table[i]->description));
}
lowranceusr4_waypt_disp((const Waypoint*)waypt_table[i]);
}
{
if (global_opts.debug_level >= 1) {
printf(MYNAME " writing route #%d (%s) with %d waypts\n",
- route_uid, CSTRc(rte->rte_name), rte->rte_waypt_ct);
+ route_uid, qPrintable(rte->rte_name), rte->rte_waypt_ct);
}
/* UID unit number */
if (global_opts.debug_level >= 2) {
if (waypt_idx > waypt_table_ct) {
printf(MYNAME " WARNING: failed finding waypoint %s in waypoint table\n",
- CSTRc(wpt->shortname));
+ qPrintable(wpt->shortname));
} else {
printf(MYNAME " adding waypt %d (%s) to route\n",
- waypt_idx, CSTRc(waypt_table[waypt_idx]->shortname));
+ waypt_idx, qPrintable(waypt_table[waypt_idx]->shortname));
}
}
{
if (global_opts.debug_level >= 1) {
printf(MYNAME " writing track %d (%s) with %d trackpoints\n",
- track_uid, CSTRc(trk->rte_name), trk->rte_waypt_ct);
+ track_uid, qPrintable(trk->rte_name), trk->rte_waypt_ct);
}
/* UID unit number */
MapfactorRead();
if (reader.hasError()) {
fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
- CSTR(reader.errorString()),
- CSTR(file.fileName()),
+ qPrintable(reader.errorString()),
+ qPrintable(file.fileName()),
(long) reader.lineNumber(),
(long) reader.columnNumber());
}
}
if (reader.hasError()) {
fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
- CSTR(reader.errorString()),
- CSTR(file.fileName()),
+ qPrintable(reader.errorString()),
+ qPrintable(file.fileName()),
(long) reader.lineNumber(),
(long) reader.columnNumber());
}
wpt = find_waypt_by_name(str);
if (wpt == NULL)
fatal(MYNAME ": No associated waypoint for route point %s (Route %s)!\n",
- str, CSTRc(rte->rte_name));
+ str, qPrintable(rte->rte_name));
route_add_wpt(rte, new Waypoint(*wpt));
}
prev = track_list[j];
if (prev.last_time >= track_list[i].first_time) {
fatal(MYNAME "-pack: Tracks overlap in time! %s >= %s at %d\n",
- CSTR(prev.last_time.toString()),
- CSTR(track_list[i].first_time.toString()), i);
+ qPrintable(prev.last_time.toString()),
+ qPrintable(track_list[i].first_time.toString()), i);
}
}
{
gbfprintf(fout, "#####\n");
fatal(MYNAME ": %s (%s) is outside of convertable area of grid \"%s\"!\n",
- wpt->shortname.isEmpty() ? "Waypoint" : CSTR(wpt->shortname),
+ wpt->shortname.isEmpty() ? "Waypoint" : qPrintable(wpt->shortname),
pretty_deg_format(wpt->latitude, wpt->longitude, 'd', NULL, 0),
gt_get_mps_grid_longname(unicsv_grid_idx, MYNAME));
}
xml_run_parser(reader, current_tag);
if (reader.hasError()) {
fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
- CSTR(reader.errorString()),
- CSTR(file.fileName()),
+ qPrintable(reader.errorString()),
+ qPrintable(file.fileName()),
(long) reader.lineNumber(),
(long) reader.columnNumber());
}
xml_run_parser(reader, current_tag);
if (reader.hasError()) {
fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
- CSTR(reader.errorString()),
+ qPrintable(reader.errorString()),
"unknown",
(long) reader.lineNumber(),
(long) reader.columnNumber());
if (attrv->hasAttribute("version")) {
if (attrv->value("version") != "1.0") {
fatal(MYNAME ": Unsupported version %s.\n",
- attrv->value("version").toString().toUtf8().constData());
+ qPrintable(attrv->value("version").toString()));
}
}
}
{
gbfprintf(fout, "#####\n");
fatal(MYNAME ": %s (%s) is outside of convertable area \"%s\"!\n",
- wpt->shortname.isEmpty() ? "Waypoint" : CSTRc(wpt->shortname),
+ wpt->shortname.isEmpty() ? "Waypoint" : qPrintable(wpt->shortname),
pretty_deg_format(wpt->latitude, wpt->longitude, 'd', NULL, 0),
gt_get_mps_grid_longname(grid_swiss, MYNAME));
}